package com.kksoft.readcm.pro.activity;

import android.content.Context;

import com.kksoft.readcm.activity.App;
import com.kksoft.readcm.activity.SettingsActivity;
import com.kksoft.readcm.objects.GlobalVar;
import com.kksoft.readcm.pro.a.b;
import com.kksoft.readcm.pro.b.a;
import com.kksoft.readcm.pro.service.BackgroundSyncService;

//@AnnotApp(AppName = "dEVaaHN2bDlJTmJ0QktDVnNtNy1FWXc6MQ")
public class ProApp extends App {
	private static com.kksoft.readcm.pro.a.b b;

	public ProApp() {
		objectM = new a();
	}

	public static com.kksoft.readcm.pro.a.b z() {
		if (b == null)
		{
			b = com.kksoft.readcm.pro.a.b.a();
		}
		return b;
	}

	public final void a(SettingsActivity paramSettingsActivity) {
		com.kksoft.readcm.pro.a.b localb = z();
		if (localb != null) {
			Context localContext = getAppThis();
			localb.a(localContext);
		}
		BackgroundSyncService.c(getAppThis());
		super.initSetting(paramSettingsActivity);
	}

	public final void b(GlobalVar paramh) {
		super.b(paramh);
		switch (paramh.a()) {
		default:
		case 91:
			com.kksoft.readcm.pro.a.b localb = z();
			if (App.getSharedPreferences().getInt("backgroundSyncingValue", 2) == 1)
			for (int i = 1;; i = 0) {
				if (i == 0) {
					if ((App.getSharedPreferences().getBoolean("firstLogin", true))
							&& (localb != null)) {
						Context localContext2 = getAppThis();
						com.kksoft.readcm.pro.activity.a locala = new com.kksoft.readcm.pro.activity.a(this);
						localb.a(localContext2, locala);
						boolean bool = App.getSharedPreferences().edit()
								.putBoolean("firstLogin", false).commit();
						continue;
					}
				}
				if (localb == null) {
					BackgroundSyncService.a(getAppThis(), 2);
					continue;
				}
				Context localContext1 = getAppThis();
				com.kksoft.readcm.pro.activity.b localb1 = new com.kksoft.readcm.pro.activity.b(this);
				localb.a(localContext1, localb1);
				break;
			}
			BackgroundSyncService.a(getAppThis());
		}
	}
}